Skip to content

Conversation

@pkulikov
Copy link
Contributor

Copy link
Contributor

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @pkulikov. Your changes look really good. I've left a few comments and suggestions. But the final example isn't being included in the build, and I have no idea why. I'll close and reopen this PR to see if it mysteriously appears with the rebuild.


Usage of the conditional operator over an [if-else](../keywords/if-else.md) statement might result in more concise code in cases when you need conditionally to compute a value. The following example demonstrates two ways to classify an integer as negative or nonnegative:

[!code-csharp[conditional and if-else](~/samples/snippets/csharp/language-reference/operators/ConditionalExamples.cs#CompareWithIf)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example is not building, and I have no idea why:

image

The build is also not generating any warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rpetrusha I also didn't notice any warnings even before the samples PR was merged. Does it build properly after merging the samples PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest build shows no warnings, and the code appears as expected, @pkulikov
I have no idea of why one block of code was not found when the others were.

@rpetrusha
Copy link
Contributor

Closing and reopening to begin new build.

@pkulikov
Copy link
Contributor Author

@rpetrusha thanks for review; I've addressed your feedback.

@rpetrusha rpetrusha merged commit 3339f1b into dotnet:master Nov 20, 2018
@pkulikov pkulikov deleted the revise-conditional-operator branch November 21, 2018 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants